﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using AdvanceLib.ScriptCore;

namespace AdvanceLib.ScriptCore.Formatters
{
    public class ExtendableFormatter : IFormatter
    {
        #region Constructors
        public ExtendableFormatter()
        {
            this.Formatters = new List<IFormatter>();
        }
        #endregion

        #region Properties
        public List<IFormatter> Formatters { get; set; }
        #endregion

        #region IFormatter Member
        public string Format(string input)
        {
            string output = input;
            foreach (IFormatter formatter in this.Formatters)
            {
                output = formatter.Format(output);
            }
            return output;
        }
        #endregion
    }
}
